package com.briup.jz.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.briup.jz.bean.Platform;
import com.briup.jz.bean.PlatformExample;
import com.briup.jz.dao.PlatformMapper;
import com.briup.jz.service.IPlatformService;
@Service
public class PlatformImpl implements IPlatformService{
	@Autowired
	private PlatformMapper platformmapper;

	@Override
	public List<Platform> selectAll(PlatformExample platformexample) {
		// TODO Auto-generated method stub
		return platformmapper.selectByExample(platformexample);
	}

	@Override
	public void saveOrUpdate(Platform platform) {
		if(platform.getId()!=null)
			platformmapper.updateByPrimaryKey(platform);
		else {
			platformmapper.insert(platform);
		}
		
	}

	@Override
	public void deleteById(Long id) {
		platformmapper.deleteByPrimaryKey(id);
		
	}

	@Override
	public Platform selectById(Long id) {
		// TODO Auto-generated method stub
		return platformmapper.selectByPrimaryKey(id);
	}

}
